Since OpenXava 5.3 the new Hibernate Validator included in OpenXava uses the standard Bean Validation API instead of its own API, therefore the code in the section 6.2 of this lesson does not work as is with OpenXava 5.3. Use the next code instead:
packageorg.openxava.facturacion.annotations;importjava.lang.annotation.*;importjavax.validation.*;importorg.openxava.facturacion.validators.*;
@Constraint(validatedBy = ISBNValidator.class)
@Target({ElementType.FIELD, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)public @interface ISBN {Class<?>[] groups()default{};Class<?extends Payload>[] payload()default{};boolean search()defaulttrue;String message()default"ISBN does not exist";}
You need to copy the following libraries from OpenXava/lib to Invoicing/web/WEB-INF/lib: cssparser.jar, htmlunit.jar, htmlunit-core-js.jar, httpclient.jar, httpcore.jar, httpmime.jar, nekothml.jar, sac.jar, xalan.jar, xercesImpl.jar. Also you need to download the following library and add it into the same folder: xml-apis-2.10.0.jar
Lesson 6: Advanced validation
This lesson is available in PDF:Note for OpenXava 5.3 and better
Since OpenXava 5.3 the new Hibernate Validator included in OpenXava uses the standard Bean Validation API instead of its own API, therefore the code in the section 6.2 of this lesson does not work as is with OpenXava 5.3. Use the next code instead:ISBNValidator.java
ISBN.java:
You need to copy the following libraries from OpenXava/lib to Invoicing/web/WEB-INF/lib: cssparser.jar, htmlunit.jar, htmlunit-core-js.jar, httpclient.jar, httpcore.jar, httpmime.jar, nekothml.jar, sac.jar, xalan.jar, xercesImpl.jar. Also you need to download the following library and add it into the same folder: xml-apis-2.10.0.jar
Any problem with this lesson? Ask in the forum Everything fine? Go to Lesson 7